<template>
  <div style="padding-top: 18px;">
    <dv-scroll-board :config="config" class="table" style="height:31vh" />
    <!-- <dv-decoration-7 style="height:18px; position: absolute;top: 0;left: 0; font-size: 14px;">
      物料领用
    </dv-decoration-7> -->
  </div>
</template>

<script>
// import moment from 'moment'
import {materialLingYongApi} from '../../../api/product/index.js'
export default {
  name: '',
  data() {
    return {
      config: {
        // invcode,invname,invspec,use_qty, dai_use_qty,sum_quantity,
        header: ['存货编码','存货名称', '规格', '使用数', '待用数', '备料数'],
        headerHeight: 20,
        data: [],
        index: false,
        columnWidth: [140, 200, 120,100,100,100],
        align: ['left'],
        headerBGC: ' ',
        oddRowBGC: ' ',
        evenRowBGC: 'rgba(52,99,171,0.15)',
        waitTime: 3000,
        rowNum: 20,
      },
      dataList: [],
    }
  },
  props: {
  },
  mounted() {
    this.getData()
  },
  methods: {
    getData() {
      const _that = this
      materialLingYongApi({pkCorp: 1002}).then(res => {
        const {code,data} = res
        if(code === 2000) {
          _that.dataList = data
          const mConfig = {..._that.config}
          mConfig['data'] = []
          data.forEach(mData => {
            const m = []
            m.push(`<span style="font-size:12px">${mData.invcode}</sapn>`)
            m.push(`<span style="font-size:12px">${mData.invname}</sapn>`)
            m.push(mData.invspec)
            m.push(mData.useQty)
            m.push(mData.daiUseQty)
            m.push(mData.sumQuantity)
            mConfig.data.push(m)
          });
          _that.config = mConfig
        }
      })
    },
  },
}
</script>

<style lang="less" scoped>
.table {
  .px2vw(padding-left, 10);
  .px2vw(padding-right, 10);
}
/deep/ .row-item{
    height: 28px !important;
    line-height: 28px !important;
}
</style>
